import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("user_group", { schema: "predict" })
export class UserGroup {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("varchar", { name: "name", length: 20, default: () => "'账号'" })
  name: string;

  @Column("varchar", { name: "code", length: 30, default: () => "'编码'" })
  code: string;

  @Column("decimal", {
    name: "price",
    comment: "价格",
    precision: 6,
    scale: 2,
    default: () => "'0.00'",
  })
  price: string;

  @Column("int", {
    name: "expire",
    comment: "有效期",
    unsigned: true,
    default: () => "'0'",
  })
  expire: number;

  @Column("tinyint", {
    name: "expire_type",
    comment: "有效期类型",
    unsigned: true,
    default: () => "'1'",
  })
  expireType: number;

  @Column("int", {
    name: "sort",
    comment: "排序",
    unsigned: true,
    default: () => "'0'",
  })
  sort: number;

  @Column("varchar", { name: "remark", length: 50, default: () => "'备注'" })
  remark: string;

  @Column("boolean", { name: "enable" })
  enable: boolean;

  @Column("int", { name: "creator_id", unsigned: true, default: () => "'0'" })
  creatorId: number;

  @Column("int", { name: "create_time", unsigned: true, default: () => "'0'" })
  createTime: number;

  @Column("int", { name: "update_time", unsigned: true, default: () => "'0'" })
  updateTime: number;
}
